import javax.swing.JLabel as JLabel
import java
import java.awt.BorderLayout as BorderLayout
import java.lang.System.out as out
import com.sun.j3d.utils.universe.SimpleUniverse as SimpleUniverse
import javax.media.j3d.Canvas3D as Canvas3D
import javax.media.j3d.BranchGroup as BranchGroup
import com.sun.j3d.utils.geometry.ColorCube as ColorCube

java.lang.System.out.println("Started running script, with container " + apanel.toString())

def main(panel) :
	lbl = JLabel("Hey there! How are you Deodatta.")
	#out.println(java.lang.System.getProperty("java.library.path"))
	panel.setLayout(BorderLayout())
	panel.add(lbl)
	panel.setVisible(True)
	graphicsConfig = SimpleUniverse.getPreferredConfiguration()
	canvas3d = Canvas3D(graphicsConfig)
	universe = SimpleUniverse(canvas3d)
	group = BranchGroup();
	group.addChild(ColorCube(0.3));
	universe.getViewingPlatform().setNominalViewingTransform();
	universe.addBranchGraph(group);
	panel.add(canvas3d, BorderLayout.CENTER)

try :
	main(apanel)
except e :
	out.println("EXCEPTION " + ":"*50)
	out.println(e)

out.println("Script finished.")
